<%@ include file="/WEB-INF/views/includes.jsp" %>
<%@ include file="/WEB-INF/views/header.jsp" %>
<%@ page session="false" %>

<h1>Student View</h1>

<%--
***********************************************************************************
							Enrolled Courses
***********************************************************************************
 --%>
<p style="font-weight: bold;">
	<img style="vertical-align:middle;margin-right:5px;" src="<c:url value='/resources/images/book.png' />"/> 
	You are enrolled in the following courses:
</p>

<c:choose>
	<c:when test="${fn:length(courses) > 0}">
		<table style="width:100%;" class="bluetable">
			<tr>
				<th style="width: 10%"><b>Code</b></th>
				<th style="width: 40%"><b>Course Name</b></th>
				<th style="width: 10%"><b>Faculty</b></th>
				<th style="width: 40%"><b>Documents</b></th>
			</tr>
			<c:forEach var="course" items="${courses}">
				<tr>
					<td>${course.code}</td>
					<td>${course.name}</td>
					<td>${course.faculty.name}</td>
					<td>
						<c:forEach var="document" items="${course.documents}">
							<a class="icon-link document-link" href="javascript:alert('This feature was not completed for this assignment. (Not really necessary).');">
								<img style="margin-right:5px;" src="<c:url value='/resources/images/page_white_put.png' />"/> 
								${document.fileName}
							</a><br/>
						</c:forEach>		
					</td>
				</tr>
			</c:forEach>
		</table>
	</c:when>
	<c:otherwise>
		<p style="font-style:italic;margin-left:20px;">You are not actively enrolled in any courses.</p>
	</c:otherwise>
</c:choose>
<%--
***********************************************************************************
							Shared Documents
***********************************************************************************
 --%>
<p style="font-weight:bold;margin-top:30px;">
	<img style="vertical-align:middle;margin-right:5px;" src="<c:url value='/resources/images/page_white_go.png' />"/> 
	Shared Documents:
</p>

<c:choose>
	<c:when test="${fn:length(documents) > 0}">
		<table style="width:400px;" class="bluetable">
			<tr>
				<th style="width: 50%"><b>Document Name</b></th>
				<th style="width: 50%"><b>Shared By</b></th>
			</tr>
			<c:forEach var="document" items="${documents}">
				<tr>
					<td><a href="javascript:alert('This feature was not completed for this assignment. (Not really necessary).');">${document.fileName}</a></td>
					<td>${document.creator.username}</td>
				</tr>
			</c:forEach>
		</table>
	</c:when>
	<c:otherwise>
		<p style="font-style:italic;margin-left:20px;">There are currently no documents being directly shared with you.</p>
	</c:otherwise>
</c:choose>

<%@ include file="/WEB-INF/views/footer.jsp" %>
